#ifndef MYWEBENGINEVIEW_H
#define MYWEBENGINEVIEW_H
#include <qglobal.h>

#if (QT_VERSION >= QT_VERSION_CHECK(5,0,0))
#include <QWebEngineView>
#include <QOpenGLWidget>
#include <QPointer>
#include <QEvent>

class MyWebEngineView : public QWebEngineView
{
    Q_OBJECT
public:
    explicit MyWebEngineView(QWidget *parent = 0);

    void setArrowToolMode(bool isArrowTool){
        m_bIsArrowTool = isArrowTool;
    }

signals:
    void eventTransit(QEvent*);

public slots:

protected:
    virtual QWebEngineView *createWindow(QWebEnginePage::WebWindowType type);
    virtual bool event(QEvent * ev);
    virtual bool eventFilter(QObject *obj, QEvent *ev);

private:
    QPointer<QOpenGLWidget> child_;
    bool m_bIsArrowTool;
};

#endif

#endif // MYWEBENGINEVIEW_H
